package com.boot.mybatis.controller;

import com.boot.commons.vo.User;
import com.boot.mybatis.repository.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserMapper userMapper;

    @GetMapping("/")
    public List<User> list() {

        return userMapper.getAll();


    }

    @PostMapping("/enum")
    public User test(@RequestBody() User user) {

        return user;

    }


}
